/*
 * interface for the top level data structure
 */

#ifndef __TOPLEVEL_H
#define __TOPLEVEL_H

struct SchemeObject ;

/* entry of a symbol in the top level */
typedef struct SymbolEntry
{
	string name ;
	bool isDefined ;
	struct SchemeObject* sob ;
} SymbolEntry ;
#define SYMBOL_ENTRY(x)		((SymbolEntry*)(x))
#define SYMBOL_ENTRY_OBJ(x) (SYMBOL_ENTRY(x)->sob)

/* returns a pointer to the requested symbol, if it's in the top level, or null otherwise. */
SymbolEntry* probeForSymbol(string name) ;
/* returns a pointer to the requested symbol. if it isn't in the top level, it is created. */
SymbolEntry* getSymbol(string name) ;

void bindToGlobalEnv (string name,MachineCode label);

#endif /* __TOPLEVEL_H */
